home *** CD-ROM | disk | FTP | other *** search
/ Know Your Baseball - The Greatest Player Resource / Know Your Baseball - Greatest Player.iso / Baseball / Director / KTGCST.CST / 00067_Script_rollover_module < prev    next >
Text File  |  1998-09-21  |  2KB  |  70 lines

  1. global EnterRollist,XitRollist,lastrollover,thisrollover
  2.  
  3.  
  4. --- put the name of the handler that you want executed
  5. -- for a specific sprite when the rollover occurs
  6. --  in the internal cast in a field called onlist
  7. -- eg sprite 4 in list four
  8. -- the first item in the line should be a number then the
  9. -- desired command separated by a ",'
  10. -- the off list affects what happens when the rollover ends
  11. -- and also requires a handler to be named
  12. -- if no name is present nothing will happen
  13. -- however both onlist and off list must have 48 lines with
  14. -- a number at the start of each of the 48 lines
  15.  
  16. on initrolloverKit
  17.   set EnterRollist = []
  18.   set XitRollist = []
  19.   set the itemDelimiter = ","
  20.   repeat with x = 1 to 48
  21.     set t = item 2 of (line x of field "onlist" of castlib "internal")
  22.     setat(EnterRollist,x,t)
  23.     set r = item 2 of (line x of field "offlist" of castlib "internal")
  24.     setat(XitRollist,x,r)
  25.   end repeat 
  26. end
  27.  
  28.  
  29. on testforrollovers
  30.   set thisrollover = the rollover
  31.   if thisrollover = 0 then exit
  32.   if (thisRollover <> LastRollover) then
  33.     if lastRollover > 0 then
  34.       do getat(Xitrollist,lastrollover)
  35.     end if
  36.     do getat(EnterRollist, thisrollover)
  37.     set lastrollover = thisRollover
  38.   end if
  39. end
  40.  
  41. -- turns coach or announcer icon off at end of file
  42. on soundover
  43.   if soundbusy(1) then exit
  44.   set flag1 = getat(gbuttonstate,40)
  45.   set flag2 =  getat(gbuttonstate,41)
  46.   set flag = max(flag1,flag2)
  47.   if flag > 0 then
  48.     Autoresetbanner
  49.   end if   
  50.   -- reset golden rule if it was selected
  51.   if getat(gbuttonstate,24) > 0 then
  52.     set the blend of sprite 24 = 0 -- Turnoff Golden rule
  53.     setat(gbuttonState,24,0)
  54.     set the membernum of sprite 24 = the membernum of sprite 24-1
  55.   end if
  56. end
  57.  
  58. on autoresetbanner
  59.   repeat with y = 41 down to 40
  60.     set thisone = getat(gbuttonState,y)
  61.     if thisone > 0  then 
  62.       set the membernum of sprite y = the membernum of sprite y -1
  63.       setat(gbuttonState,y,0)
  64.       exit repeat
  65.     end if
  66.   end repeat 
  67.   if the rollover <> y then set the blend of sprite y = 0
  68.   updatestage
  69. end
  70.